/**
 * 
 * @author zjh527@gmail.com
 */
function BaseObj(o){
	this.editObj = o;
}

BaseObj.prototype.toString = function(){
    return "BaseObj";
}

BaseObj.prototype.onReady = function(){
    var $editObj = jQuery(this.editObj);
    
    //设置只读属性
    if($editObj.attr("isReadonly")=="true"){
        $editObj.attr("readonly","readonly");
    }
    
    if($editObj.attr("isDisabled")=="true"){
        $editObj.attr("disabled","disabled");
    }	
}

/**
 * 取得输入框中鼠标当前位置
 * @return {}
 */
BaseObj.prototype.getCursorIndex = function(){
    if(!jQuery.browser.msie){
        return this.editObj.selectionEnd;
    }else{
        var r = document.selection.createRange(); //创建文档选择对象 
        r.setEndPoint("StartToStart", this.editObj.createTextRange()); //在以前的文档选择对象和新的对象之间创建对象 
        cursor_index = r.text.length;
        return cursor_index;
    }	
}

